package controllers

import (
	"encoding/json"
	"fmt"

	beego "github.com/beego/beego/v2/server/web"
)

type LoginController struct {
	beego.Controller
}

type testit struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

func (c *LoginController) Post() {

	// c.Ctx.Output.Header("Access-Control-Allow-Origin", "*")
	var test testit
	data := c.Ctx.Input.RequestBody
	json.Unmarshal(data, &test)
	fmt.Println(test)
	fmt.Println("xxx")
	c.Data["json"] = &test
	c.ServeJSON()
}
